#! /bin/bash
import rospy
from std_msgs.msg import String
"""
初始化ros节点
创建订阅者对象
回调函数处理数据
"""
def callback(msg):
    rospy.loginfo(msg.data)

rospy.init_node("sub")
sub=rospy.Subscriber("che",String,callback,queue_size=10)
rospy.spin()